package com.huawei;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.*;

/**
 * Description: HJ23 删除字符串中出现次数最少的字符
 *
 *
 * 注意：Collectors需要导入的包是java.util.stream.* 如果导入的是java.util.*,无法编译通过！！！
 * @author weiruibai.vendor
 * Date: 2022/8/18 14:10
 */
public class HJ23 {

    public static void main(String[] args) throws IOException {
        BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        String str = read.readLine();
        Map<Character, Integer> map = new HashMap<>();
        for (Character cha : str.toCharArray()) {
            map.put(cha, map.getOrDefault(cha, 0) + 1);
        }
        Collection<Integer> values = map.values();
        List<Integer> list = values.stream().sorted((o1, o2) -> o1 - o2).collect(Collectors.toList());
        Integer min = list.get(0);
        for (Map.Entry<Character, Integer> m : map.entrySet()) {
            if (m.getValue() == min) {
                str = str.replaceAll(m.getKey() + "", "");
            }
        }
        System.out.println(str);
        read.close();
    }
}
